package com.itao.netty;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.handler.codec.LengthFieldBasedFrameDecoder;

/**
 * @Author sjt
 * @CreateTime 2025/9/24 11:28
 */
public class EmbeddedChannelTest {

    public static void main(String[] args) {

        EmbeddedChannel embeddedChannel = new EmbeddedChannel(
                new LengthFieldBasedFrameDecoder(1024, 0, 1, 0, 0)
        );
        ByteBuf buffer = Unpooled.buffer();
        buffer.writeByte(1);
        embeddedChannel.writeInbound(buffer);
        buffer = Unpooled.buffer();
        buffer.writeByte(96);
        embeddedChannel.writeInbound(buffer);
    }
}
